import React, { useRef } from 'react'

const RefTest = () => {
    const inputRef = useRef<HTMLInputElement>(null)

    const handleClick = () => {
        console.log(inputRef.current)
        inputRef.current!.focus()
    }

    return (
        <div>
            <input type="text" ref={inputRef} />
            <button onClick={handleClick}>focus</button>
        </div>
    )
}

export default RefTest
